<?php
    include '../iframe/public/db_object.php';
    //开启Session 
    session_start();

    @$login_name = $_SESSION['login_name'];
    //$a = $_COOKIE;
    
    //echo $_COOKIE[session_name()];
    if(empty($login_name)){
        echo json_encode(['id'=>0]);
    }else{
        $db = new DB_object(['db_name'=> 'db_shop']);
        $sql = "select * from admi_power where login_name='".$login_name."'";
        $res = $db->l_select_one($sql);
        if(empty($res)){
            echo '数据库查询失败!';
            exit;
        }
        echo json_encode(array('id'=> 1, 'login_name'=>$login_name, 'data'=> $res));
    }
    //echo $login_name; 


?>